package com.youdianda.mapper;

import com.youdianda.entity.YddArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository()
public interface YddArticleMapper {
    /**
     * 文章总数
     * @return
     */
    @Select("select count(*) from ydd_article")
    Integer getNumber();

    /**
     * 热门文章数据
     * @return
     */
    @Select("select id,title,author,keywords,click from ydd_article where ishot=1")
    List<YddArticle> getHot();
}
